package br.com.dev.tcc.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class CalendarParser {

	public static Calendar getCalendar(String date){
		
		Calendar calendar = Calendar.getInstance();

		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd",
				Locale.getDefault());

		try {
			Date date2 = format.parse(date);
			calendar.setTime(date2);
		} catch (ParseException e) {
			return null;
		}
		
		return calendar;
	}
}
